home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume7 / gb2 / patch1b < prev    next >
Encoding:
Internet Message Format  |  1989-09-18  |  55.1 KB

  1. Path: uunet!zephyr.ens.tek.com!tekgen!tekred!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v08i027:  GB2 - Galactic Bloodshed, an empire-like war game [Ver. 1.0], Patch1b
  5. Message-ID: <4576@tekred.CNA.TEK.COM>
  6. Date: 15 Sep 89 15:26:27 GMT
  7. Sender: nobody@tekred.CNA.TEK.COM
  8. Lines: 1977
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: VANCLEEF@mps.ohio-state.edu
  12. Posting-number: Volume 8, Issue 27
  13. Archive-name: GB2/Patch1b
  14. Patch-To: GB2: Volume 7, Issue 44-51
  15.  
  16.  
  17. #! /bin/sh
  18. # This is a shell archive.  Remove anything before this line, then unpack
  19. # it by saving it into a file and typing "sh file".  To overwrite existing
  20. # files, type "sh file -c".  You can also feed this as standard input via
  21. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  22. # will see the following message at the end:
  23. #        "End of archive 2 (of 4)."
  24. # Contents:  patches01b
  25. # Wrapped by billr@saab on Fri Sep 15 08:21:57 1989
  26. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  27. if test -f 'patches01b' -a "${1}" != "-c" ; then 
  28.   echo shar: Will not clobber existing file \"'patches01b'\"
  29. else
  30. echo shar: Extracting \"'patches01b'\" \(52681 characters\)
  31. sed "s/^X//" >'patches01b' <<'END_OF_FILE'
  32. X*** ../../GB2/enrol.c    Wed Jul  5 15:15:14 1989
  33. X--- enrol.c    Fri Sep 15 07:27:57 1989
  34. X***************
  35. X*** 23,33 ****
  36. X     compatible with everything.  */
  37. X  float Likes[DES_PLATED+1][DES_PLATED+1] = {
  38. X                 /* DES_SEA     DES_LAND   DES_MOUNT  DES_GAS DES_ICE DES_PLATED*/
  39. X! /*DES_SEA  */      1.0,        0.0,        0.0,       0.3,     0.05,    1.0,
  40. X  /*DES_LAND */      0.0,        1.0,        0.5,       0.0,     0.1,     1.0,
  41. X  /*DES_MOUNT*/      0.0,        0.5,        1.0,       0.0,     0.3,     1.0,
  42. X  /*DES_GAS  */      0.5,        0.0,        0.0,       1.0,     0.0,     1.0,
  43. X! /*DES_ICE  */      0.05,       0.15,       0.3,       0.0,     1.0,     1.0,
  44. X  /*DES_PLATED*/     1.0,        1.0,        1.0,       1.0,     1.0,     1.0
  45. X  };
  46. X  
  47. X--- 23,33 ----
  48. X     compatible with everything.  */
  49. X  float Likes[DES_PLATED+1][DES_PLATED+1] = {
  50. X                 /* DES_SEA     DES_LAND   DES_MOUNT  DES_GAS DES_ICE DES_PLATED*/
  51. X! /*DES_SEA  */      1.0,        0.0,        0.0,       0.3,     0.1,    1.0,
  52. X  /*DES_LAND */      0.0,        1.0,        0.5,       0.0,     0.1,     1.0,
  53. X  /*DES_MOUNT*/      0.0,        0.5,        1.0,       0.0,     0.3,     1.0,
  54. X  /*DES_GAS  */      0.5,        0.0,        0.0,       1.0,     0.0,     1.0,
  55. X! /*DES_ICE  */      0.1,        0.15,       0.3,       0.0,     1.0,     1.0,
  56. X  /*DES_PLATED*/     1.0,        1.0,        1.0,       1.0,     1.0,     1.0
  57. X  };
  58. X  
  59. X***************
  60. X*** 46,52 ****
  61. X  char *loginname;
  62. X  {
  63. X  int x,y, or;
  64. X! int pnum,star=0,found=0,i,j,enroll_pdata,
  65. X      ifd, enroll_sectdata, enroll_stardata,mask,ppref = -1;
  66. X  char str[100], c;
  67. X  sectortype *sect;
  68. X--- 46,52 ----
  69. X  char *loginname;
  70. X  {
  71. X  int x,y, or;
  72. X! int pnum,star=0,found=0,vacant,count,i,j,enroll_pdata,
  73. X      ifd, enroll_sectdata, enroll_stardata,mask,ppref = -1;
  74. X  char str[100], c;
  75. X  sectortype *sect;
  76. X***************
  77. X*** 73,78 ****
  78. X--- 73,79 ----
  79. X      exit(0);
  80. X   }
  81. X  
  82. X+ 
  83. X     /* look at enroll screen */
  84. X   sprintf(str, "%s %s", PAGER, ENROLL_FL);
  85. X   system(str);
  86. X***************
  87. X*** 98,129 ****
  88. X      }
  89. X  
  90. X      /* find first planet of right type */
  91. X!   star = 0; found = 0;
  92. X!   while (!found && star<Sdata.numstars) {
  93. X!    for (or=i=0; i<howmanybytes(Playernum); i++ )
  94. X!     or |= Stars[star]->explored[i];
  95. X!       /* make sure no one has explored the star */
  96. X!    if (!or) {
  97. X       pnum = 0;
  98. X       while (!found && pnum<Stars[star]->numplanets) {
  99. X          openpdata(&enroll_pdata);
  100. X          getplanet(enroll_pdata,&planet,Stars[star]->planetpos[pnum]);
  101. X!         if (planet->type==ppref) {
  102. X              found = 1;
  103. X!         } else {
  104. X!             close(enroll_pdata);
  105. X!             free(planet);
  106. X!             pnum++;
  107. X!         }
  108. X       }
  109. X!    }
  110. X     if (!found)
  111. X!      star++;
  112. X!   }
  113. X  
  114. X  
  115. X     if (!found) {
  116. X!     printf(" Uhoh, there don't seem to be any of that type of planet left.\n");
  117. X      not_found[ppref] = 1;
  118. X      for (found=1,i=TYPE_EARTH; i<=TYPE_GASGIANT; i++)
  119. X          found &= not_found[i];
  120. X--- 99,142 ----
  121. X      }
  122. X  
  123. X      /* find first planet of right type */
  124. X!     count = 0;
  125. X!     star = int_rand(0,Sdata.numstars);
  126. X!     found = 0;
  127. X!   while (!found && count < 100) {
  128. X!       /* look for unihabited planets */
  129. X! 
  130. X       pnum = 0;
  131. X       while (!found && pnum<Stars[star]->numplanets) {
  132. X          openpdata(&enroll_pdata);
  133. X          getplanet(enroll_pdata,&planet,Stars[star]->planetpos[pnum]);
  134. X! 
  135. X!         vacant = 1;
  136. X!     for (i=0; i<Playernum-1; i++ )
  137. X!     {    
  138. X!     if (planet->info[i].numsectsowned != 0) vacant = 0;
  139. X!     }
  140. X! 
  141. X!         if(vacant && planet->type==ppref)
  142. X!          {
  143. X              found = 1;
  144. X!           } else {
  145. X!                 close(enroll_pdata);
  146. X!                 free(planet);
  147. X!                 pnum++;
  148. X!             }
  149. X       }
  150. X! 
  151. X     if (!found)
  152. X!     {
  153. X!     count ++;
  154. X!     star = int_rand(0,Sdata.numstars);
  155. X!     }
  156. X  
  157. X  
  158. X+ }
  159. X+ 
  160. X     if (!found) {
  161. X!        printf(" planet type not found after 100 systems randomly searched.");
  162. X      not_found[ppref] = 1;
  163. X      for (found=1,i=TYPE_EARTH; i<=TYPE_GASGIANT; i++)
  164. X          found &= not_found[i];
  165. X***************
  166. X*** 210,216 ****
  167. X      printw("    Adventurists: %.2f\n",Race->nonhomebodies);
  168. X      printw("            Mass: %.2f\n",Race->mass);
  169. X      printw(" Number of sexes: %d (min req'd for colonization)\n",Race->number_sexes);
  170. X!     printw("\n\n  (%d re-rolls left) * type spacebar ' ' to reroll    :", --i);
  171. X      refresh();
  172. X      if (getchr()!=' ')
  173. X          found = 1;
  174. X--- 223,229 ----
  175. X      printw("    Adventurists: %.2f\n",Race->nonhomebodies);
  176. X      printw("            Mass: %.2f\n",Race->mass);
  177. X      printw(" Number of sexes: %d (min req'd for colonization)\n",Race->number_sexes);
  178. X!     printw("\n\n  (%d re-rolls left) space to reroll:", --i);
  179. X      refresh();
  180. X      if (getchr()!=' ')
  181. X          found = 1;
  182. X***************
  183. X*** 280,286 ****
  184. X   planet->info[Playernum-1].numsectsowned = 1;
  185. X   planet->is_explored = 0;
  186. X   planet->info[Playernum-1].explored = 1;
  187. X!  planet->info[Playernum-1].autorep = 1;
  188. X  
  189. X  
  190. X   sect->owner = Playernum;
  191. X--- 293,299 ----
  192. X   planet->info[Playernum-1].numsectsowned = 1;
  193. X   planet->is_explored = 0;
  194. X   planet->info[Playernum-1].explored = 1;
  195. X!  /*planet->info[Playernum-1].autorep = 1;*/
  196. X  
  197. X  
  198. X   sect->owner = Playernum;
  199. X*** ../../GB2/enroll.dat    Wed Jul  5 15:15:55 1989
  200. X--- enroll.dat    Fri Sep 15 07:28:55 1989
  201. X***************
  202. X*** 7,13 ****
  203. X  
  204. X  
  205. X                           Welcome to
  206. X!                 Galactic Bloodshed Version 0.975
  207. X                     Written by Robert Chansky
  208. X  
  209. X  
  210. X--- 7,13 ----
  211. X  
  212. X  
  213. X                           Welcome to
  214. X!                   Galactic Bloodshed
  215. X                     Written by Robert Chansky
  216. X  
  217. X  
  218. X***************
  219. X*** 26,31 ****
  220. X--- 26,75 ----
  221. X  
  222. X  
  223. X  
  224. X+ 
  225. X+             Version 1.1 (ohio state)
  226. X+                 9/15/89
  227. X+ 
  228. X+           Adapted from the original program by
  229. X+ 
  230. X+                Robert Chansky
  231. X+             Univ. California/Santa Cruz
  232. X+ 
  233. X+ 
  234. X+               modifications programmed by
  235. X+             
  236. X+             Garrett Van Cleef, Ph.D
  237. X+                Dept. of Physics
  238. X+             The Ohio State University
  239. X+ 
  240. X+ 
  241. X+ 
  242. X+ 
  243. X+ 
  244. X+ 
  245. X+ 
  246. X+ 
  247. X+              V1.0 playtesting by
  248. X+ 
  249. X+                  Hanan Baddar
  250. X+                   Ken Bloch
  251. X+                  John Davis
  252. X+                  Robert Jones
  253. X+              Menelaos Kafkaladis
  254. X+                  Brett Lowry
  255. X+                  Paul Murphy
  256. X+               Garrett van Cleef
  257. X+                Wolfgang Wenzel
  258. X+ 
  259. X+                 -----
  260. X+ 
  261. X+                Dept. of Physics
  262. X+               The Ohio State University
  263. X+ 
  264. X+ 
  265. X+ 
  266. X+ 
  267. X+ 
  268. X          You look around in the slime.  
  269. X  
  270. X          Isn't there, you think, something more to life?  
  271. X***************
  272. X*** 65,70 ****
  273. X--- 109,119 ----
  274. X           9 #####.#########-#######################  <-- Ice (polar cap)
  275. X  
  276. X     
  277. X+ 
  278. X+ 
  279. X+ 
  280. X+ 
  281. X+ 
  282. X                Gasgiant Planet                           Airless Planet
  283. X     000000000011111111112222222222333333333          0000000000111111111122
  284. X     012345678901234567890123456789012345678          0123456789012345678901
  285. X*** ../../GB2/enslave.c    Wed Jul  5 15:15:15 1989
  286. X--- enslave.c    Fri Sep 15 07:27:58 1989
  287. X***************
  288. X*** 97,103 ****
  289. X  
  290. X    openshdata(&enslave_shdata);
  291. X    sh = p->ships;
  292. X-   Locks(1);
  293. X    while (sh) {
  294. X      (void)getship(enslave_shdata, &s2, sh);
  295. X      if (p->info[s2->owner].numsectsowned && s2->owner!=Playernum)
  296. X--- 97,102 ----
  297. X***************
  298. X*** 107,113 ****
  299. X      sh = s2->nextship;
  300. X      free(s2);
  301. X    }
  302. X-   Locks(0);
  303. X    close(enslave_shdata);
  304. X  
  305. X    deductAPs(APcount, s->storbits, 0);
  306. X--- 106,111 ----
  307. X*** ../../GB2/exam.dat    Wed Jul  5 15:15:56 1989
  308. X--- exam.dat    Fri Sep 15 07:28:57 1989
  309. X***************
  310. X*** 13,19 ****
  311. X  with this extra cargo.  Shuttles are one of the few classes of ships that can
  312. X  construct other ships.
  313. X  ~
  314. X! Dreadnaught
  315. X      This is a well-armored but large (and slow due to it's mass) 
  316. X  interstellar warship.
  317. X  
  318. X--- 13,43 ----
  319. X  with this extra cargo.  Shuttles are one of the few classes of ships that can
  320. X  construct other ships.
  321. X  ~
  322. X! Carrier
  323. X! 
  324. X!    A must for every fleet. The carriers are similar to current and past
  325. X! aircraft carriers in both a strategic and tactical sense. They have 
  326. X! relatively small gunnery strengths and defensive capabilities, however, 
  327. X! these deficiencies are far outweighed by their ability to transport 
  328. X! large amounts of fighter craft for use in battle. This makes these 
  329. X! ships dominant components of any battle fleet.
  330. X! 
  331. X!    Each carrier can transport an unlimited number of fighters, however, 
  332. X! the mass of the carrier and its fighters as well as overhead requirements 
  333. X! of the fighters will set a 'realistic' limit of the numbers that 
  334. X! individual players may want to carry. If a carrier gets destroyed for 
  335. X! whatever reason, all docked fighters will also be destroyed.
  336. X! 
  337. X!   The docking of fighters and carriers is handled differently than that
  338. X! between other ships. The fighter must be designated as the first ship in
  339. X! the docking command with the carrier as designated secondly. This will
  340. X! add the fighter to the linked list of fighters designated to the
  341. X! carrier and remove it from the list of ships orbiting a star/planet.
  342. X! These will not show up on the 'report' and similar displays unless the
  343. X! scope is set to the carrier. At this level all attached fighters are
  344. X! displayed.
  345. X! 
  346. X! ~Dreadnaught
  347. X      This is a well-armored but large (and slow due to it's mass) 
  348. X  interstellar warship.
  349. X  
  350. X***************
  351. X*** 39,67 ****
  352. X      This is a well-protected and fast light cruiser, suitable for
  353. X  escort.
  354. X  ~
  355. X! Fighter
  356. X!     A small fuel capacity and high armor class makes this ship ideal
  357. X! for in-system combat.
  358. X  ~
  359. X- Cargo ship
  360. X-     This is a long-range interstellar transport craft, with little
  361. X- weapons or armor.
  362. X- ~
  363. X  Explorer
  364. X      This is a small and fast long-range exploration craft with almost no
  365. X  weapons capacity but some armor.
  366. X  ~
  367. X! Tanker
  368. X!     This ship can carry large amounts of fuel; it can also receive more
  369. X! fuel by orbiting a gas giant.
  370. X  ~
  371. X- 
  372. X  Space Station
  373. X  
  374. X      This is an orbital military installation useful as a military depot
  375. X  as well as a planetary defense perimeter.
  376. X  
  377. X- 
  378. X  ~
  379. X  
  380. X  Orbital Assault Platform
  381. X--- 63,97 ----
  382. X      This is a well-protected and fast light cruiser, suitable for
  383. X  escort.
  384. X  ~
  385. X! Fighter Group
  386. X!     A small fuel capacity and high armor class makes these ships ideal
  387. X! for in-system combat. The tactical advantage of these ships coupled with
  388. X! their ability to be transported on carriers make these ships valuable assets
  389. X! in combat. Fighter groups represent up to 5 individual craft at full strength.
  390. X! This interpretation, however, is unimportant with the scale of the game.
  391. X! 
  392. X  ~
  393. X  Explorer
  394. X      This is a small and fast long-range exploration craft with almost no
  395. X  weapons capacity but some armor.
  396. X+ 
  397. X  ~
  398. X! Space Habitat
  399. X!     This is a residential platform, a space colony.  It can be used to
  400. X! manufacture other ships, as well as safeguard your race against extinction,
  401. X! if you choose to send it into interstellar space as an insurance measure.
  402. X!     Habitats also have sophisticated manufacturing and refining
  403. X! equipment, enabling the habitat to multiply resources it is carrying, in
  404. X! proportion to the number of people staffing it.
  405. X!     Habitats are the only ships in which citizens feel comfortable 
  406. X! enough to reproduce freely, although at a reduced rate because of the 
  407. X! crowded conditions.
  408. X  ~
  409. X  Space Station
  410. X  
  411. X      This is an orbital military installation useful as a military depot
  412. X  as well as a planetary defense perimeter.
  413. X  
  414. X  ~
  415. X  
  416. X  Orbital Assault Platform
  417. X***************
  418. X*** 70,77 ****
  419. X  recalcitrant worlds (with the 'enslave' command).  It can also be used
  420. X  for constructing other ships as can shuttles and habitats, however it
  421. X  cannot reproduce citizens or manufacture resources.
  422. X-     This device cannot be used to enslave.
  423. X  ~
  424. X  GODSHIP
  425. X      This entity pulsates, throbs with power.  Don't mess with it.
  426. X  ~
  427. X--- 100,116 ----
  428. X  recalcitrant worlds (with the 'enslave' command).  It can also be used
  429. X  for constructing other ships as can shuttles and habitats, however it
  430. X  cannot reproduce citizens or manufacture resources.
  431. X  ~
  432. X+ 
  433. X+ Cargo ship
  434. X+     This is a long-range interstellar transport craft, with little
  435. X+ weapons or armor.
  436. X+ ~
  437. X+ Tanker
  438. X+     This ship can carry large amounts of fuel; it can also receive more
  439. X+ fuel by orbiting a gas giant.
  440. X+ ~
  441. X+ 
  442. X  GODSHIP
  443. X      This entity pulsates, throbs with power.  Don't mess with it.
  444. X  ~
  445. X***************
  446. X*** 82,88 ****
  447. X  irradiated, become immobile for a certain amount of time; each turn, an 
  448. X  affected ship's crew is reduced by about 10%.
  449. X      The mine can be armed/disarmed with order, and its trigger radius 
  450. X! (0 <= trigger radius <= 200) also altered with the order command.  
  451. X  ~
  452. X  Space mirror
  453. X      This is a large plane of reflecting material, suitable for altering 
  454. X--- 121,133 ----
  455. X  irradiated, become immobile for a certain amount of time; each turn, an 
  456. X  affected ship's crew is reduced by about 10%.
  457. X      The mine can be armed/disarmed with order, and its trigger radius 
  458. X! also altered with the order command.  
  459. X!     Alien space mines are difficult to detect. They are invisible on the
  460. X! solar system maps but can be detected with the `tactical' command. 
  461. X! Their precise locations may be difficult to triangulate. They also possess
  462. X! a high defense strength since they are small objects and difficult to hit
  463. X! nonetheless find.
  464. X! 
  465. X  ~
  466. X  Space mirror
  467. X      This is a large plane of reflecting material, suitable for altering 
  468. X***************
  469. X*** 91,108 ****
  470. X  
  471. X  ~
  472. X  
  473. X- Space Habitat
  474. X-     This is a residential platform, a space colony.  It can be used to
  475. X- manufacture other ships, as well as safeguard your race against extinction,
  476. X- if you choose to send it into interstellar space as an insurance measure.
  477. X-     Habitats also have sophisticated manufacturing and refining
  478. X- equipment, enabling the habitat to multiply resources it is carrying, in
  479. X- proportion to the number of people staffing it.
  480. X-     Habitats are the only ships in which citizens feel comfortable 
  481. X- enough to reproduce freely, although at a reduced rate because of the 
  482. X- crowded conditions.
  483. X- ~
  484. X- 
  485. X  Space telescope
  486. X      This is a space-based astronomical facility, with fuel and engines
  487. X  for launching it into orbit. it has a much longer range than a 
  488. X--- 136,141 ----
  489. X***************
  490. X*** 123,129 ****
  491. X  Atmosphere processor
  492. X      This is a large machine (of the type in _Aliens_) that sucks in
  493. X  the atmosphere of a planet, converting it to the type of air preferred by its
  494. X! owner.  This process has a cost of 4 fuel units per turn.
  495. X  ~
  496. X  Canister of dust
  497. X      This is a small canister of light-absorbing dust.  When launched it
  498. X--- 156,163 ----
  499. X  Atmosphere processor
  500. X      This is a large machine (of the type in _Aliens_) that sucks in
  501. X  the atmosphere of a planet, converting it to the type of air preferred by its
  502. X! owner.  This process has a cost of 6 fuel units per turn. You must load
  503. X! fuel and crew into these objects for them to operate.
  504. X  ~
  505. X  Canister of dust
  506. X      This is a small canister of light-absorbing dust.  When launched it
  507. X***************
  508. X*** 150,156 ****
  509. X  cloak radius, until whole systems can be cloaked.
  510. X      This is a non-functional device.
  511. X  ~
  512. X- emotion suppressor
  513. X  Orbital Mind-control laser
  514. X      This device, when aimed at a ship, produces resonating vibrations
  515. X  within the ship's hull, to cause the mental attitude of the crew to
  516. X--- 184,189 ----
  517. X***************
  518. X*** 180,186 ****
  519. X      This is a brilliant necklace of obvious power.
  520. X      This is a non-functional device.
  521. X  ~
  522. X! gamma ray laser
  523. X      This device fires a deadly stream of radiation at its target when
  524. X  fired.  It uses destructive capacity in the same manner other ships use it
  525. X  for their guns.  Radiation is not accumulated in target ships; if a ship's
  526. X--- 213,219 ----
  527. X      This is a brilliant necklace of obvious power.
  528. X      This is a non-functional device.
  529. X  ~
  530. X! Gamma ray laser
  531. X      This device fires a deadly stream of radiation at its target when
  532. X  fired.  It uses destructive capacity in the same manner other ships use it
  533. X  for their guns.  Radiation is not accumulated in target ships; if a ship's
  534. X***************
  535. X*** 226,229 ****
  536. X--- 259,278 ----
  537. X  the presence of something in the hopper, it will transport this material into
  538. X  the hopper of its target device.  This process takes fuel.  The target device
  539. X  can be specified with the order command.
  540. X+ 
  541. X+     You should specify the number of the receiving transporter. If the
  542. X+ target ship is set to `0' cargo will not be transported anywhere and will
  543. X+ remain in the hopper.
  544. X  ~
  545. X+ 
  546. X+ Sector repair
  547. X+     This represents resources spent to repair environmental and structural
  548. X+ damage in a sector due to severe combat. This 'ship' is built in a sector
  549. X+ that is currently wasted '%' and reairs it for the listed cost. The repair
  550. X+ of the sector is considered complete and no repair unit per se is ever
  551. X+ displayed on the map (it is considered to represent effort and not a particular
  552. X+ vehicle). You must have resources available on the planet being repaired in
  553. X+ order to create repair units (population is not necessary).
  554. X+ 
  555. X+ ~
  556. X+ 
  557. X*** ../../GB2/examine.c    Wed Jul  5 15:15:16 1989
  558. X--- examine.c    Fri Sep 15 07:27:59 1989
  559. X***************
  560. X*** 30,36 ****
  561. X      return;
  562. X      }
  563. X  
  564. X!     if (ship->is_dead) {
  565. X      printf("that ship is dead.\n");
  566. X      free(ship);
  567. X      close(shdata);
  568. X--- 30,36 ----
  569. X      return;
  570. X      }
  571. X  
  572. X!     if (!ship->is_alive) {
  573. X      printf("that ship is dead.\n");
  574. X      free(ship);
  575. X      close(shdata);
  576. X*** ../../GB2/files.h    Wed Jul  5 15:14:53 1989
  577. X--- files.h    Fri Sep 15 07:27:37 1989
  578. X***************
  579. X*** 51,54 ****
  580. X  #define PLAYER_GOD "vancleef"
  581. X  #define GOD_PASSWORD "god"
  582. X  #define PLAYER_GROUP_ID 937
  583. X- 
  584. X--- 51,53 ----
  585. X*** ../../GB2/files_shl.c    Wed Jul  5 15:15:20 1989
  586. X--- files_shl.c    Fri Sep 15 07:28:01 1989
  587. X***************
  588. X*** 73,79 ****
  589. X        printf("unable to open %s\n",PLANETDATAFL);
  590. X        exit(-1);
  591. X   }
  592. X-  /*printf("openpdata %d\n",*fd);*/
  593. X  }
  594. X  
  595. X  
  596. X--- 73,78 ----
  597. X***************
  598. X*** 90,101 ****
  599. X  
  600. X  
  601. X  
  602. X- 
  603. X  getsdata(fd,S)
  604. X  int fd;
  605. X  struct stardata *S;
  606. X  {
  607. X    Fileread(fd,(char *)S, sizeof(struct stardata), STARDATAFL, 0 );
  608. X  }
  609. X  
  610. X  
  611. X--- 89,101 ----
  612. X  
  613. X  
  614. X  
  615. X  getsdata(fd,S)
  616. X  int fd;
  617. X  struct stardata *S;
  618. X  {
  619. X+ /**/    Locks(1);
  620. X    Fileread(fd,(char *)S, sizeof(struct stardata), STARDATAFL, 0 );
  621. X+     Locks(0);
  622. X  }
  623. X  
  624. X  
  625. X***************
  626. X*** 110,118 ****
  627. X        printf("unable to open %s\n",RACEDATAFL);
  628. X        exit(-1);
  629. X   }
  630. X!  /*printf(" getrace rnum %d posn %d.\n",rnum,(rnum-1)*sizeof(racetype) );*/
  631. X   Fileread(fd, (char *)*r, sizeof(racetype), RACEDATAFL,
  632. X              (rnum-1)*sizeof(racetype) );
  633. X   close(fd);
  634. X  }
  635. X  
  636. X--- 110,119 ----
  637. X        printf("unable to open %s\n",RACEDATAFL);
  638. X        exit(-1);
  639. X   }
  640. X! /**/Locks(1);
  641. X   Fileread(fd, (char *)*r, sizeof(racetype), RACEDATAFL,
  642. X              (rnum-1)*sizeof(racetype) );
  643. X+ /**/Locks(0);
  644. X   close(fd);
  645. X  }
  646. X  
  647. X***************
  648. X*** 123,130 ****
  649. X--- 124,133 ----
  650. X  int star;
  651. X  {
  652. X   *s = (startype *)malloc(sizeof(startype));
  653. X+ /**/Locks(1);
  654. X   Fileread(fd,(char *)*s, sizeof(startype), STARDATAFL, 
  655. X      (int)(sizeof(Sdata)+star*sizeof(startype)) );
  656. X+   Locks(0);
  657. X  }
  658. X  
  659. X  
  660. X***************
  661. X*** 134,141 ****
  662. X  int filepos;
  663. X  {
  664. X   *p = (planettype *)malloc(sizeof(planettype));
  665. X   Fileread(fd,(char *)*p, sizeof(planettype), PLANETDATAFL, filepos );
  666. X!  /*printf(" getplanet pointer=%x, smappos=%d\n",*p,(*p)->sectormappos);*/
  667. X  }
  668. X  
  669. X  
  670. X--- 137,145 ----
  671. X  int filepos;
  672. X  {
  673. X   *p = (planettype *)malloc(sizeof(planettype));
  674. X+ /**/Locks(1);
  675. X   Fileread(fd,(char *)*p, sizeof(planettype), PLANETDATAFL, filepos );
  676. X!     Locks(0);
  677. X  }
  678. X  
  679. X  
  680. X***************
  681. X*** 145,151 ****
  682. X--- 149,157 ----
  683. X  int filepos;
  684. X  {
  685. X   *s = (sectortype *)malloc(sizeof(sectortype));
  686. X+ /**/Locks(1);
  687. X   Fileread(fd,(char *)*s, sizeof(sectortype), SECTORDATAFL, filepos );
  688. X+     Locks(0);
  689. X  }
  690. X  
  691. X  
  692. X***************
  693. X*** 154,162 ****
  694. X  sectortype *map;
  695. X  planettype *p;
  696. X  {
  697. X!  /*printf(" getting map posn %d\n", p->sectormappos);*/
  698. X   Fileread(fd,(char *)map, p->Maxx * p->Maxy * sizeof(sectortype), 
  699. X      SECTORDATAFL, p->sectormappos);
  700. X  }
  701. X  
  702. X  
  703. X--- 160,169 ----
  704. X  sectortype *map;
  705. X  planettype *p;
  706. X  {
  707. X! /**/Locks(1);
  708. X   Fileread(fd,(char *)map, p->Maxx * p->Maxy * sizeof(sectortype), 
  709. X      SECTORDATAFL, p->sectormappos);
  710. X+     Locks(0);
  711. X  }
  712. X  
  713. X  
  714. X***************
  715. X*** 172,180 ****
  716. X--- 179,190 ----
  717. X      printf("Illegal ship number %d\n",shipnum);
  718. X      return 0;
  719. X   } else {
  720. X+ /**/Locks(1);
  721. X       *s = (shiptype *)malloc(sizeof(shiptype));
  722. X       Fileread(fd, (char *)*s, sizeof(shiptype), SHIPDATAFL,
  723. X                      (shipnum-1)*sizeof(shiptype) );
  724. X+     Locks(0);
  725. X+ 
  726. X      return 1;
  727. X   }
  728. X  }
  729. X***************
  730. X*** 213,225 ****
  731. X            exit(-1);
  732. X        }
  733. X          /* put topmost entry in fpos */
  734. X      Fileread(fd, (char *)&shnum, sizeof(short), SHIPFREEDATAFL, 
  735. X              buf.st_size - sizeof(short) );
  736. X          /* erase that entry, since it will now be filled */
  737. X      ftruncate(fd, (long)(buf.st_size-sizeof(short)) );
  738. X      close(fd);
  739. X-     if (shnum == 0)shnum=-1;
  740. X- 
  741. X      return (int)shnum;
  742. X   } else
  743. X      return -1;
  744. X--- 223,235 ----
  745. X            exit(-1);
  746. X        }
  747. X          /* put topmost entry in fpos */
  748. X+ /**/Locks(1);
  749. X      Fileread(fd, (char *)&shnum, sizeof(short), SHIPFREEDATAFL, 
  750. X              buf.st_size - sizeof(short) );
  751. X          /* erase that entry, since it will now be filled */
  752. X      ftruncate(fd, (long)(buf.st_size-sizeof(short)) );
  753. X+ /**/Locks(0);
  754. X      close(fd);
  755. X      return (int)shnum;
  756. X   } else
  757. X      return -1;
  758. X***************
  759. X*** 231,237 ****
  760. X--- 241,249 ----
  761. X  int fd;
  762. X  struct stardata *S;
  763. X  {
  764. X+     Locks(1);
  765. X    Filewrite(fd,(char *)S, sizeof(struct stardata), STARDATAFL, 0 );
  766. X+     Locks(0);
  767. X  }
  768. X  
  769. X  
  770. X***************
  771. X*** 245,252 ****
  772. X--- 257,266 ----
  773. X        printf("unable to open %s\n",RACEDATAFL);
  774. X        exit(-1);
  775. X   }
  776. X+ Locks(1);
  777. X   Filewrite(fd,(char *)r, sizeof(racetype), RACEDATAFL, 
  778. X          (r->Playernum-1)*sizeof(racetype) );
  779. X+ Locks(0);
  780. X   close(fd);
  781. X   /*printf(" putrace pl#%d posn %d\n",r->Playernum,(r->Playernum-1)*sizeof(racetype) );*/
  782. X  }
  783. X***************
  784. X*** 257,264 ****
  785. X--- 271,280 ----
  786. X  startype *s;
  787. X  int snum;
  788. X  {
  789. X+     Locks(1);
  790. X    Filewrite(fd,(char *)s, sizeof(startype), STARDATAFL, 
  791. X          (int)(sizeof(Sdata)+snum*sizeof(startype)) );
  792. X+     Locks(0);
  793. X  }
  794. X  
  795. X  putplanet(fd,p,filepos)
  796. X***************
  797. X*** 266,272 ****
  798. X--- 282,290 ----
  799. X  planettype *p;
  800. X  int filepos;
  801. X  {
  802. X+     Locks(1);
  803. X   Filewrite(fd,(char *)p, sizeof(planettype), PLANETDATAFL, filepos );
  804. X+     Locks(0);
  805. X  }
  806. X  
  807. X  putsector(fd,s,filepos)
  808. X***************
  809. X*** 274,280 ****
  810. X--- 292,300 ----
  811. X  sectortype *s;
  812. X  int filepos;
  813. X  {
  814. X+     Locks(1);
  815. X   Filewrite(fd,(char *)s, sizeof(sectortype), SECTORDATAFL, filepos );
  816. X+     Locks(0);
  817. X  }
  818. X  
  819. X  
  820. X***************
  821. X*** 283,290 ****
  822. X--- 303,312 ----
  823. X  sectortype *map;
  824. X  planettype *p;
  825. X  {
  826. X+     Locks(1);
  827. X   Filewrite(fd, (char *)map,
  828. X      p->Maxx * p->Maxy * sizeof(sectortype), SECTORDATAFL, p->sectormappos);
  829. X+     Locks(0);
  830. X  }
  831. X  
  832. X  putship(fd,s,shipnum)
  833. X***************
  834. X*** 292,299 ****
  835. X--- 314,323 ----
  836. X  shiptype *s;
  837. X  int shipnum;
  838. X  {
  839. X+     Locks(1);
  840. X   Filewrite(fd,(char *)s, sizeof(shiptype), SHIPDATAFL, 
  841. X          (shipnum-1)*sizeof(shiptype) );
  842. X+     Locks(0);
  843. X  }
  844. X  
  845. X  
  846. X***************
  847. X*** 341,346 ****
  848. X--- 365,372 ----
  849. X  
  850. X    shipno = shipnum;    /* conv to u_short */
  851. X  
  852. X+  if(shipnum == 0)return;
  853. X+ 
  854. X    if ( (fd = open(SHIPFREEDATAFL, O_WRONLY, 0777)) < 0) {
  855. X        perror("openshfdata");
  856. X        printf("unable to open %s\n",SHIPFREEDATAFL);
  857. X***************
  858. X*** 350,357 ****
  859. X    printf("ship #%u destroyed.\n", shipno);
  860. X      /* write the ship # at the very end of SHIPFREEDATAFL */
  861. X    fstat(fd,&buf);
  862. X    Filewrite(fd,(char *)&shipno, sizeof(shipno), SHIPFREEDATAFL, buf.st_size );
  863. X! 
  864. X  }
  865. X  
  866. X  
  867. X--- 376,384 ----
  868. X    printf("ship #%u destroyed.\n", shipno);
  869. X      /* write the ship # at the very end of SHIPFREEDATAFL */
  870. X    fstat(fd,&buf);
  871. X+     Locks(1);
  872. X    Filewrite(fd,(char *)&shipno, sizeof(shipno), SHIPFREEDATAFL, buf.st_size );
  873. X!     Locks(0);
  874. X  }
  875. X  
  876. X  
  877. X***************
  878. X*** 369,371 ****
  879. X--- 396,403 ----
  880. X   write(power_fd, (char *)p, sizeof(*p)*MAXPLAYERS );
  881. X   close(power_fd);
  882. X  }
  883. X+ 
  884. X+ 
  885. X+ 
  886. X+ 
  887. X+ 
  888. X*** ../../GB2/fire.c    Thu Jul  6 07:19:21 1989
  889. X--- fire.c    Fri Sep 15 07:28:03 1989
  890. X***************
  891. X*** 20,30 ****
  892. X  int argn;
  893. X  char args[MAXARGS][COMMANDSIZE];
  894. X  {
  895. X! placetype from,to;
  896. X! planettype *fpl,*tpl;
  897. X  sectortype *sect;
  898. X! int dam=0,dam2=0,strength,oldstrength,maxstrength,
  899. X      i,from_firex= -1,from_firey= -1,firex= -1,firey= -1,Numplayersretaliate=0;
  900. X  float dist;
  901. X  char string[PLACENAMESIZE],buf[200];
  902. X  char shoot_msg[1000], retal_msg[1000];
  903. X--- 20,32 ----
  904. X  int argn;
  905. X  char args[MAXARGS][COMMANDSIZE];
  906. X  {
  907. X! placetype from,to,to2;
  908. X! planettype *fpl,*tpl,*tpl2;
  909. X  sectortype *sect;
  910. X! int dam=0,dam2=0,dam3=0,
  911. X!     strength,oldstrength,maxstrength,tostrength,to2strength,
  912. X      i,from_firex= -1,from_firey= -1,firex= -1,firey= -1,Numplayersretaliate=0;
  913. X+ int sh;
  914. X  float dist;
  915. X  char string[PLACENAMESIZE],buf[200];
  916. X  char shoot_msg[1000], retal_msg[1000];
  917. X***************
  918. X*** 53,58 ****
  919. X--- 55,62 ----
  920. X      printf("usage: fire\n");
  921. X      return; 
  922. X   }
  923. X+ 
  924. X+ 
  925. X   if (from.level == LEVEL_UNIV || from.level == LEVEL_STAR) {
  926. X      printf("You can't shoot from there.\n");
  927. X      fire_handler();
  928. X***************
  929. X*** 129,137 ****
  930. X     scanf("%35s",string);
  931. X   } else sscanf(args[2],"%35s",string);
  932. X  
  933. X-  Locks(1);
  934. X   to = Getplace(string,1);
  935. X-  Locks(0);
  936. X  
  937. X   if (to.err)
  938. X      fire_handler();
  939. X--- 133,139 ----
  940. X***************
  941. X*** 142,167 ****
  942. X          if (from.shipno == to.shipno) {
  943. X              printf("You can't do that.\n");
  944. X              fire_handler();
  945. X!         } else
  946. X!             Locks(1);    /* ship file will already be locked */
  947. X      }
  948. X          /* get ship again */
  949. X      openshdata(&fire_toshdata);
  950. X      free(to.shipptr);
  951. X      (void)getship(fire_toshdata, &(to.shipptr), to.shipno);
  952. X-     Locks(0);
  953. X  
  954. X!     if (to.shipptr->is_dead) {
  955. X          printf("that ship has already been destroyed.\n");
  956. X          fire_handler();
  957. X      }
  958. X  
  959. X      if (to.shipptr->is_docked && to.shipptr->whatdest==LEVEL_PLAN) {
  960. X-             Locks(1);
  961. X              openpdata(&fire_topdata);
  962. X              getplanet(fire_topdata,&tpl,Stars[to.snum]->planetpos[to.pnum]);
  963. X              close(fire_topdata);
  964. X-             Locks(0);
  965. X      }
  966. X  
  967. X   } else if (to.level==LEVEL_PLAN) {
  968. X--- 144,170 ----
  969. X          if (from.shipno == to.shipno) {
  970. X              printf("You can't do that.\n");
  971. X              fire_handler();
  972. X!         }
  973. X! 
  974. X      }
  975. X          /* get ship again */
  976. X      openshdata(&fire_toshdata);
  977. X      free(to.shipptr);
  978. X      (void)getship(fire_toshdata, &(to.shipptr), to.shipno);
  979. X  
  980. X!     if (!to.shipptr->is_alive) {
  981. X          printf("that ship has already been destroyed.\n");
  982. X          fire_handler();
  983. X      }
  984. X  
  985. X+ /* save defense attack strength for retaliation */
  986. X+   tostrength = MIN(to.shipptr->destruct,   
  987. X+             Shipdata[to.shipptr->type][ABIL_GUNS]*(100-to.shipptr->damage)/100.);
  988. X+ 
  989. X      if (to.shipptr->is_docked && to.shipptr->whatdest==LEVEL_PLAN) {
  990. X              openpdata(&fire_topdata);
  991. X              getplanet(fire_topdata,&tpl,Stars[to.snum]->planetpos[to.pnum]);
  992. X              close(fire_topdata);
  993. X      }
  994. X  
  995. X   } else if (to.level==LEVEL_PLAN) {
  996. X***************
  997. X*** 171,178 ****
  998. X                  /* same planet as firing one */
  999. X             sameplanet = 1;
  1000. X             tpl = fpl;
  1001. X!         } else
  1002. X!            Locks(1);
  1003. X      }
  1004. X  
  1005. X      if (!sameplanet) {
  1006. X--- 174,180 ----
  1007. X                  /* same planet as firing one */
  1008. X             sameplanet = 1;
  1009. X             tpl = fpl;
  1010. X!         }
  1011. X      }
  1012. X  
  1013. X      if (!sameplanet) {
  1014. X***************
  1015. X*** 179,185 ****
  1016. X          openpdata(&fire_topdata);
  1017. X          getplanet(fire_topdata,&tpl,Stars[to.snum]->planetpos[to.pnum]);
  1018. X      }
  1019. X-     Locks(0);
  1020. X  
  1021. X       /* ask user for sector of planet to shoot at */
  1022. X          printf("Aim at");
  1023. X--- 181,186 ----
  1024. X***************
  1025. X*** 192,198 ****
  1026. X   }
  1027. X  
  1028. X  
  1029. X!     /* prompt if hes your ally */
  1030. X    if ( to.level==LEVEL_SHIP && isset(Race->allied, to.shipptr->owner) ) {
  1031. X      tty_on();
  1032. X      printf("Fire on your ally? (y/n)");
  1033. X--- 193,199 ----
  1034. X   }
  1035. X  
  1036. X  
  1037. X!     /* prompt if he's your ally */
  1038. X    if ( to.level==LEVEL_SHIP && isset(Race->allied, to.shipptr->owner) ) {
  1039. X      tty_on();
  1040. X      printf("Fire on your ally? (y/n)");
  1041. X***************
  1042. X*** 213,236 ****
  1043. X      getchr();
  1044. X   } else sscanf(args[3],"%d",&strength);
  1045. X   if (strength>maxstrength) {
  1046. X!     printf("Too large.\n");
  1047. X         fire_handler();
  1048. X-  } else if (strength<=0) {
  1049. X-        printf("wimp.\n");
  1050. X-        fire_handler();
  1051. X   }
  1052. X  
  1053. X      /* block kill signals to foil cheaters */
  1054. X   mask = sigblock(SIGINT | SIGQUIT | SIGSTOP);
  1055. X  
  1056. X   dam = shoot(from,&to,fpl,tpl,firex,firey,strength, &dist, shoot_msg,
  1057. X          1 );    /*1==get smap*/
  1058. X!  printf("Distance to target: %.0f, maximum distance: %d.\n",dist, SYSTEMSIZE);
  1059. X   if (dam < 0) {
  1060. X      printf("Target out of range!\n", SYSTEMSIZE);
  1061. X      fire_handler();
  1062. X!  }
  1063. X  
  1064. X   if (from.level==LEVEL_SHIP) {
  1065. X      from.shipptr->destruct -= strength;
  1066. X      from.shipptr->mass -= strength*MASS_DESTRUCT;
  1067. X--- 214,271 ----
  1068. X      getchr();
  1069. X   } else sscanf(args[3],"%d",&strength);
  1070. X   if (strength>maxstrength) {
  1071. X!     strength = maxstrength;
  1072. X!     printf("set to strength %d\n",maxstrength);
  1073. X!  }
  1074. X!  
  1075. X!     if (strength<=0) {
  1076. X!        printf("no attack.\n");
  1077. X         fire_handler();
  1078. X   }
  1079. X  
  1080. X      /* block kill signals to foil cheaters */
  1081. X   mask = sigblock(SIGINT | SIGQUIT | SIGSTOP);
  1082. X  
  1083. X+ 
  1084. X   dam = shoot(from,&to,fpl,tpl,firex,firey,strength, &dist, shoot_msg,
  1085. X          1 );    /*1==get smap*/
  1086. X!  printf("Distance to target: %.0f, maximum distance: %d\n\n",dist, SYSTEMSIZE);
  1087. X   if (dam < 0) {
  1088. X      printf("Target out of range!\n", SYSTEMSIZE);
  1089. X      fire_handler();
  1090. X!  } 
  1091. X  
  1092. X+  printf("BO\007OM!!\n%s\n", shoot_msg);
  1093. X+ 
  1094. X+  teleg_add("",telegram_buf);
  1095. X+  sprintf(buf," BULLETIN from %s\n\n",Dispplace(&from));
  1096. X+  teleg_add(buf,telegram_buf);
  1097. X+ 
  1098. X+ if(from.level==LEVEL_SHIP)
  1099. X+     sprintf(buf,"%s #%u ",Shipnames[from.shipptr->type],from.shipno);
  1100. X+ 
  1101. X+ if(from.level==LEVEL_PLAN)
  1102. X+     sprintf(buf,"%s ", Dispplace(&from));
  1103. X+ 
  1104. X+ /* sprintf(buf,"%s%s ",from.level==LEVEL_SHIP ? 
  1105. X+         "%s ",Shipnames[from.shipptr->type] : "", Dispplace(&from)); */
  1106. X+  teleg_add(buf,telegram_buf);
  1107. X+  if (to.level==LEVEL_SHIP)
  1108. X+     sprintf(buf,"fired on %s #%u @ %s;\n", Shipnames[to.shipptr->type],
  1109. X+             to.shipno, prin_ship_orbits(to.shipptr));
  1110. X+  else
  1111. X+     sprintf(buf,"fired on planet %s;\n", Dispplace(&to));
  1112. X+ 
  1113. X+  teleg_add(buf,telegram_buf);
  1114. X+   /* add telegram message */
  1115. X+  teleg_add(shoot_msg, telegram_buf);
  1116. X+ 
  1117. X+  for (i=1; i<MAXPLAYERS; i++)
  1118. X+     if (Nuked[i] && i!=Playernum)
  1119. X+      teleg_send(TELEG_PLAYER_AUTO, i, telegram_buf);
  1120. X+ 
  1121. X+ 
  1122. X+ 
  1123. X   if (from.level==LEVEL_SHIP) {
  1124. X      from.shipptr->destruct -= strength;
  1125. X      from.shipptr->mass -= strength*MASS_DESTRUCT;
  1126. X***************
  1127. X*** 237,276 ****
  1128. X   } else if (from.level==LEVEL_PLAN) 
  1129. X      fpl->info[Playernum-1].destruct -= strength;
  1130. X  
  1131. X- 
  1132. X-   /* enemy retaliates (if he can) */
  1133. X- 
  1134. X      strength = 0;
  1135. X!  if ( to.level==LEVEL_SHIP ) {
  1136. X!     strength = MIN(to.shipptr->destruct,Shipdata[to.shipptr->type][ABIL_GUNS] *(100-to.shipptr->damage)/100.);
  1137. X! 
  1138. X      to.shipptr->destruct -= strength;
  1139. X      to.shipptr->mass -= strength*MASS_DESTRUCT;
  1140. X  
  1141. X!  } else if (to.level==LEVEL_PLAN) {    /* all players owning planet retal */
  1142. X  
  1143. X!     int strength2;
  1144. X!     oldstrength = strength;
  1145. X      strength = 0;
  1146. X!     for (i=1; i<MAXPLAYERS; i++)
  1147. X!        if (tpl->info[i-1].destruct>0 && i!=Playernum && Nuked[i]) {
  1148. X!          strength2 = MIN(oldstrength, tpl->info[i-1].destruct);
  1149. X           if (strength2 > PLAN_FIRE_LIM)
  1150. X          strength2 = PLAN_FIRE_LIM;
  1151. X           tpl->info[i-1].destruct -= strength2;
  1152. X!          strength += strength2;
  1153. X           Numplayersretaliate++;
  1154. X!          printf("Player %d returns fire, strength %d.\n", i, strength2);
  1155. X         }
  1156. X   }
  1157. X  
  1158. X-     /* enemy fires at shooting sector */
  1159. X-  if ( !(to.level==LEVEL_SHIP && to.shipptr->is_dead) )
  1160. X      dam2=0;
  1161. X-      if(strength>0)dam2 = shoot(to,&from,tpl,fpl,from_firex,from_firey,strength, &dist, 
  1162. X-         retal_msg, 1);
  1163. X  
  1164. X  
  1165. X   if (from.level==LEVEL_PLAN) {
  1166. X       putplanet(fire_frompdata,fpl,Stars[from.snum]->planetpos[from.pnum]);
  1167. X      close(fire_frompdata);
  1168. X--- 272,397 ----
  1169. X   } else if (from.level==LEVEL_PLAN) 
  1170. X      fpl->info[Playernum-1].destruct -= strength;
  1171. X  
  1172. X      strength = 0;
  1173. X!  if ( to.level==LEVEL_SHIP && dist <= 400. && !to.shipptr->rad) {
  1174. X!     strength = tostrength;
  1175. X      to.shipptr->destruct -= strength;
  1176. X      to.shipptr->mass -= strength*MASS_DESTRUCT;
  1177. X  
  1178. X!  } else if (to.level==LEVEL_PLAN && dist<= 400.) {    
  1179. X! /* all players owning planet retal. do not retaliate at long distances
  1180. X!     since it is 'unrealistic' and easy to drain defences */
  1181. X  
  1182. X!     int strength0, strength1, strength2, sh;
  1183. X! 
  1184. X      strength = 0;
  1185. X!     for (i=1; i<= Numraces(); i++)
  1186. X!        if (i!=Playernum && tpl->info[i-1].numsectsowned) {
  1187. X!         strength0 = 0;
  1188. X!         strength1 = 0;
  1189. X!         strength2 = 0;
  1190. X! /* all aliens races which  inhabit the planet fire their ships at the
  1191. X! attacker as defensive support */
  1192. X!         openshdata(&fire_toshdata);
  1193. X!             /* go through liked list of ships 
  1194. X!                 orbiting the planet */
  1195. X!         sh = tpl->ships;
  1196. X! 
  1197. X!     while (sh) {
  1198. X! 
  1199. X!         free(to.shipptr);
  1200. X!         (void)getship(fire_toshdata, &(to.shipptr), sh);
  1201. X!         if(to.shipptr->owner == i && !to.shipptr->rad) {
  1202. X! 
  1203. X!         strength0 = MIN(to.shipptr->destruct,
  1204. X!             Shipdata[to.shipptr->type][ABIL_GUNS]*(100-to.shipptr->damage)/100.);
  1205. X!         strength1 += strength0;
  1206. X!         to.shipptr->destruct -= strength0;
  1207. X!         putship(fire_toshdata, to.shipptr, sh);
  1208. X! 
  1209. X!             }
  1210. X!         sh = to.shipptr->nextship;
  1211. X!         }
  1212. X!         close(fire_toshdata);
  1213. X! 
  1214. X! /* add planet defense strength */
  1215. X! 
  1216. X!          strength2 = tpl->info[i-1].destruct;
  1217. X           if (strength2 > PLAN_FIRE_LIM)
  1218. X          strength2 = PLAN_FIRE_LIM;
  1219. X           tpl->info[i-1].destruct -= strength2;
  1220. X! 
  1221. X!          strength += strength1;
  1222. X!              strength += strength2;
  1223. X           Numplayersretaliate++;
  1224. X!          if(strength1)printf("Player %d ships returns fire, total strength %d.\n", i, strength1);
  1225. X!          if(strength2)printf("Planet returns fire with strength %d\n\n", strength2);
  1226. X         }
  1227. X   }
  1228. X  
  1229. X      dam2=0;
  1230. X  
  1231. X+      if(strength>0)dam2 = shoot(to,&from,tpl,fpl,from_firex,from_firey,strength, &dist, retal_msg, 1);
  1232. X  
  1233. X+ 
  1234. X+  if (tostrength > 0) {
  1235. X+        printf("%s retaliates with %sstrength %d!!\n", Dispplace(&to), 
  1236. X+         Numplayersretaliate>1 ? "total " : "", strength, dam2);
  1237. X+     puts(retal_msg);
  1238. X+ 
  1239. X+  } else printf("%s cannot retaliate.\n",Dispplace(&to) );
  1240. X+ 
  1241. X+ /* protecting ships retaliate individually - ship-to-ship combat only */
  1242. X+     if(to.level==LEVEL_SHIP && from.level==LEVEL_SHIP) {
  1243. X+ 
  1244. X+     if(to.shipptr->whatorbits==LEVEL_STAR) /* star level ships */
  1245. X+         sh = Stars[to.shipptr->storbits]->ships;
  1246. X+     if(to.shipptr->whatorbits==LEVEL_PLAN) /* planet level ships */
  1247. X+         {
  1248. X+         openpdata(&fire_frompdata);
  1249. X+         getplanet(fire_frompdata,&tpl,Stars[to.snum]->planetpos[to.pnum]);
  1250. X+         close(fire_frompdata);
  1251. X+         sh = tpl->ships;
  1252. X+         }
  1253. X+ 
  1254. X+     while (sh && from.shipptr->is_alive) 
  1255. X+             {
  1256. X+     sprintf(string,"#%d",sh);
  1257. X+      to2 = Getplace(string,1);
  1258. X+ 
  1259. X+     if(sh != from.shipno)
  1260. X+     {
  1261. X+ 
  1262. X+     if(to2.shipptr->is_alive && !to2.shipptr->rad 
  1263. X+         && to2.shipptr->protect.on 
  1264. X+         && (to2.shipptr->protect.ship == to.shipno) )
  1265. X+         {
  1266. X+   to2strength = MIN(to2.shipptr->destruct,   
  1267. X+             Shipdata[to2.shipptr->type][ABIL_GUNS]*(100-to2.shipptr->damage)/100.);
  1268. X+     to2.shipptr->destruct -= to2strength;
  1269. X+     to2.shipptr->mass -= strength*MASS_DESTRUCT;
  1270. X+      if(to2strength>0)
  1271. X+     {
  1272. X+     dam3 = shoot(to2,&from,tpl,fpl,from_firex,from_firey,to2strength, &dist, retal_msg, 1);
  1273. X+ 
  1274. X+  if (to2strength > 0) {
  1275. X+        printf("%s retaliates with %sstrength %d!!\n", Dispplace(&to2), 
  1276. X+         Numplayersretaliate>1 ? "total " : "", to2strength, dam3);
  1277. X+     puts(retal_msg);
  1278. X+ 
  1279. X+  } else printf("%s cannot retaliate.\n",Dispplace(&to) );
  1280. X+ 
  1281. X+     }
  1282. X+     putship(fire_toshdata,to2.shipptr,to2.shipno); 
  1283. X+         }
  1284. X+ 
  1285. X+         }
  1286. X+         sh = to2.shipptr->nextship;
  1287. X+ 
  1288. X+             }
  1289. X+     }
  1290. X+ 
  1291. X+ 
  1292. X   if (from.level==LEVEL_PLAN) {
  1293. X       putplanet(fire_frompdata,fpl,Stars[from.snum]->planetpos[from.pnum]);
  1294. X      close(fire_frompdata);
  1295. X***************
  1296. X*** 292,327 ****
  1297. X  
  1298. X  
  1299. X  
  1300. X-  printf("BO\007OM!!\n%s", shoot_msg);
  1301. X  
  1302. X-  teleg_add("",telegram_buf);
  1303. X-  sprintf(buf," BULLETIN from %s\n\n",Dispplace(&from));
  1304. X-  teleg_add(buf,telegram_buf);
  1305. X-  sprintf(buf,"%s%s ",from.level==LEVEL_SHIP ? "ship " : "", Dispplace(&from));
  1306. X-  teleg_add(buf,telegram_buf);
  1307. X-  if (to.level==LEVEL_SHIP)
  1308. X-     sprintf(buf,"fired on ship #%u @ %s;\n", to.shipno,
  1309. X-             prin_ship_orbits(to.shipptr));
  1310. X-  else
  1311. X-     sprintf(buf,"fired on planet %s;\n", Dispplace(&to));
  1312. X  
  1313. X-  teleg_add(buf,telegram_buf);
  1314. X-   /* add telegram message */
  1315. X-  teleg_add(shoot_msg, telegram_buf);
  1316. X- 
  1317. X-  for (i=1; i<MAXPLAYERS; i++)
  1318. X-     if (Nuked[i] && i!=Playernum)
  1319. X-      teleg_send(TELEG_PLAYER_AUTO, i, telegram_buf);
  1320. X- 
  1321. X- 
  1322. X-  if (dam2 > 0) {
  1323. X-        printf("%s retaliates with %sstrength %d!!\n", Dispplace(&to), 
  1324. X-         Numplayersretaliate>1 ? "total " : "", strength, dam2);
  1325. X-     puts(retal_msg);
  1326. X- 
  1327. X-  } else printf("%s cannot retaliate.\n",Dispplace(&to) );
  1328. X- 
  1329. X- 
  1330. X   if (from.level==LEVEL_PLAN) {
  1331. X     /* firing from planet -- deduct APs from that star */
  1332. X       deductAPs(APcount, from.snum, 0);
  1333. X--- 413,420 ----
  1334. X***************
  1335. X*** 338,343 ****
  1336. X--- 431,437 ----
  1337. X  
  1338. X  
  1339. X   sigsetmask(mask);    /* reset mask */
  1340. X+ 
  1341. X  
  1342. X  }
  1343. X  
  1344. X*** ../../GB2/fix.c    Wed Jul  5 15:15:22 1989
  1345. X--- fix.c    Fri Sep 15 07:28:04 1989
  1346. X***************
  1347. X*** 53,59 ****
  1348. X--- 53,62 ----
  1349. X      query(FLOAT,"adventurists",&Race->nonhomebodies,0,0,0,0);
  1350. X      query(FLOAT,"metabolism",&Race->metabolism,0,0,0,0);
  1351. X      query(FLOAT,"overbirthrate",&Race->overbirthrate,0,0,0,0);
  1352. X+ 
  1353. X      query(INT, "Playernum",0,&Race->Playernum,0,0,0);
  1354. X+     query(CHAR, "defsystem",0,0,&Race->defsystem,0,0);
  1355. X+     query(CHAR, "defplanetnum",0,0,&Race->defplanetnum,0,0);
  1356. X      query(CHAR, "fighters",0,0,&Race->fighters,0,0);
  1357. X      query(CHAR, "IQ",0,0,&Race->IQ,0,0);
  1358. X      query(CHAR, "# sexes",0,0,&Race->number_sexes,0,0);
  1359. X***************
  1360. X*** 74,81 ****
  1361. X      query(CHAR, "Sulfur",0,0,&Race->conditions[SULFUR],0,0);
  1362. X      query(CHAR, "Helium",0,0,&Race->conditions[HELIUM],0,0);
  1363. X      query(CHAR, "Other",0,0,&Race->conditions[OTHER],0,0);
  1364. X!     if (fix_mod)
  1365. X!         putrace(Race);
  1366. X  } else {
  1367. X  
  1368. X   switch (Dir.level) {
  1369. X--- 77,85 ----
  1370. X      query(CHAR, "Sulfur",0,0,&Race->conditions[SULFUR],0,0);
  1371. X      query(CHAR, "Helium",0,0,&Race->conditions[HELIUM],0,0);
  1372. X      query(CHAR, "Other",0,0,&Race->conditions[OTHER],0,0);
  1373. X!     if (fix_mod){
  1374. X!         printf("saving");
  1375. X!         putrace(Race);}
  1376. X  } else {
  1377. X  
  1378. X   switch (Dir.level) {
  1379. X***************
  1380. X*** 117,122 ****
  1381. X--- 121,127 ----
  1382. X          setbit(Stars[Dir.snum]->explored, Playernum);
  1383. X      ch = !!isset(Stars[Dir.snum]->inhabited, Playernum);
  1384. X        query(CHAR, "inhabited",0,0,&ch,0,0);
  1385. X+         
  1386. X      if (ch)
  1387. X          setbit(Stars[Dir.snum]->inhabited, Playernum);
  1388. X      ch = Stars[Dir.snum]->nova_stage;
  1389. X***************
  1390. X*** 265,270 ****
  1391. X--- 270,280 ----
  1392. X      ch = sh->owner;
  1393. X      query(CHAR, "owner",0,0,&ch,0,0);
  1394. X          sh->owner = ch;
  1395. X+ 
  1396. X+      unl = sh->type;
  1397. X+     query(LONG, "type",0,0,0,0,&unl);
  1398. X+      sh->type = unl;
  1399. X+ 
  1400. X      query(FLOAT,"x position",&sh->xpos,0,0,0,0);
  1401. X      query(FLOAT,"y position",&sh->ypos,0,0,0,0);
  1402. X      query(FLOAT,"mass",&sh->mass,0,0,0,0);
  1403. X***************
  1404. X*** 283,288 ****
  1405. X--- 293,299 ----
  1406. X       unl = sh->rad;
  1407. X      query(LONG, "irradiated",0,0,0,0,&unl);
  1408. X       sh->rad = unl;
  1409. X+ 
  1410. X       unl = sh->damage;
  1411. X      query(LONG, "damage",0,0,0,0,&unl);
  1412. X       sh->damage = unl;
  1413. X***************
  1414. X*** 302,310 ****
  1415. X      query(CHAR, "what planet dest",0,0,&ch,0,0);
  1416. X        sh->destpnum = ch;
  1417. X      query(SHORT, "what ship dest",0,0,0,&sh->destshipno,0);
  1418. X!     ch = sh->is_dead;
  1419. X!     query(CHAR, "is dead",0,0,&ch,0,0);
  1420. X!       sh->is_dead = !!ch;
  1421. X      ch = sh->notified;
  1422. X      query(CHAR, "notified",0,0,&ch,0,0);
  1423. X        sh->notified = !!ch;
  1424. X--- 313,321 ----
  1425. X      query(CHAR, "what planet dest",0,0,&ch,0,0);
  1426. X        sh->destpnum = ch;
  1427. X      query(SHORT, "what ship dest",0,0,0,&sh->destshipno,0);
  1428. X!     ch = sh->is_alive;
  1429. X!     query(CHAR, "is alive",0,0,&ch,0,0);
  1430. X!       sh->is_alive = !!ch;
  1431. X      ch = sh->notified;
  1432. X      query(CHAR, "notified",0,0,&ch,0,0);
  1433. X        sh->notified = !!ch;
  1434. X***************
  1435. X*** 321,331 ****
  1436. X      query(SHORT, "abil_max crew",0,0,0,&sh->abils[ABIL_MAXCREW],0);
  1437. X      query(SHORT, "abil_armor",0,0,0,&sh->abils[ABIL_ARMOR],0);*/
  1438. X  
  1439. X!     if (is_object(sh)) {
  1440. X!       query(SHORT, "object:number",0,0,0,&sh->orders.object.number,0);
  1441. X!       query(SHORT, "object:number2",0,0,0,&sh->orders.object.number2,0);
  1442. X!     }
  1443. X  
  1444. X      if (fix_mod) {
  1445. X          printf("Saving...\n");
  1446. X          putship(fix_shdata, sh, Dir.shipno);
  1447. X--- 332,343 ----
  1448. X      query(SHORT, "abil_max crew",0,0,0,&sh->abils[ABIL_MAXCREW],0);
  1449. X      query(SHORT, "abil_armor",0,0,0,&sh->abils[ABIL_ARMOR],0);*/
  1450. X  
  1451. X!       query(SHORT, "object:number",0,0,0,&sh->object.number,0);
  1452. X!       query(SHORT, "object:number2",0,0,0,&sh->object.number2,0);
  1453. X!       query(SHORT, "object:number3",0,0,0,&sh->object.number3,0);
  1454. X!       query(SHORT, "object:number4",0,0,0,&sh->object.number4,0);
  1455. X  
  1456. X+ 
  1457. X      if (fix_mod) {
  1458. X          printf("Saving...\n");
  1459. X          putship(fix_shdata, sh, Dir.shipno);
  1460. X***************
  1461. X*** 332,348 ****
  1462. X      }
  1463. X      close(fix_shdata);
  1464. X      break;
  1465. X- 
  1466. X- 
  1467. X-     /*ordertype orders;        /* standing orders for ship */
  1468. X-     /*unsigned augmented : 4;    /* # of times augmented (max 10) */
  1469. X-     /*unsigned whatdest : 2;    /* where going (same as Dir) */
  1470. X-     /*unsigned whatorbits : 2;    /* where orbited (same as Dir) */
  1471. X-     /*unsigned type : 4;        /* what type ship is */
  1472. X-     /*unsigned is_sheep : 1;    /* 1 bit: is under influence of mind control */
  1473. X-     /*unsigned is_docked : 1;    /* 1 bit: is landed on a planet or docked */
  1474. X-     /*unsigned has_moved : 1;    /* 1 bit: has been moved by user */
  1475. X-     /*unsigned outtafuel_notified:1; /* 1bit: has been notified of no fuel */
  1476. X  
  1477. X  
  1478. X   }
  1479. X--- 344,349 ----
  1480. X*** ../../GB2/getplace.c    Wed Jul  5 15:15:24 1989
  1481. X--- getplace.c    Fri Sep 15 07:28:07 1989
  1482. X***************
  1483. X*** 32,51 ****
  1484. X       case '#':
  1485. X             sscanf(++string,"%hd",&where.shipno);
  1486. X             openshdata(&getplace_shdata);
  1487. X-            Locks(1);
  1488. X             if (!getship(getplace_shdata,&where.shipptr,where.shipno)) {
  1489. X-             Locks(0);
  1490. X              close(getplace_shdata);
  1491. X              DontOwnErr(where.shipno);
  1492. X              where.err = 1;
  1493. X              return where;
  1494. X             }
  1495. X-            Locks(0);
  1496. X             close(getplace_shdata);
  1497. X             if ( (where.shipptr->owner==Playernum || ignoreexpl || God)
  1498. X!                 && (!where.shipptr->is_dead || God)) {
  1499. X!                if (where.shipptr->is_dead)
  1500. X!                 printf("Ship is dead.\n");
  1501. X                 where.level = LEVEL_SHIP;
  1502. X                 where.snum = where.shipptr->storbits;
  1503. X                 where.pnum = where.shipptr->pnumorbits;
  1504. X--- 32,48 ----
  1505. X       case '#':
  1506. X             sscanf(++string,"%hd",&where.shipno);
  1507. X             openshdata(&getplace_shdata);
  1508. X             if (!getship(getplace_shdata,&where.shipptr,where.shipno)) {
  1509. X              close(getplace_shdata);
  1510. X              DontOwnErr(where.shipno);
  1511. X              where.err = 1;
  1512. X              return where;
  1513. X             }
  1514. X             close(getplace_shdata);
  1515. X             if ( (where.shipptr->owner==Playernum || ignoreexpl || God)
  1516. X!                 && (where.shipptr->is_alive || God)) {
  1517. X! /*               if (!where.shipptr->is_alive)
  1518. X!                 printf("Ship is dead.\n"); */
  1519. X                 where.level = LEVEL_SHIP;
  1520. X                 where.snum = where.shipptr->storbits;
  1521. X                 where.pnum = where.shipptr->pnumorbits;
  1522. X***************
  1523. X*** 58,64 ****
  1524. X                   return where;
  1525. X             } else {
  1526. X              where.err = 1;
  1527. X!             if (where.shipptr->is_dead)
  1528. X                  printf("That ship has been destroyed.\n");
  1529. X              else
  1530. X                  DontOwnErr(where.shipno);
  1531. X--- 55,61 ----
  1532. X                   return where;
  1533. X             } else {
  1534. X              where.err = 1;
  1535. X!             if (!where.shipptr->is_alive)
  1536. X                  printf("That ship has been destroyed.\n");
  1537. X              else
  1538. X                  DontOwnErr(where.shipno);
  1539. X***************
  1540. X*** 159,168 ****
  1541. X         if (!strncmp(substr,Stars[where->snum]->pnames[i],l)) {
  1542. X           where->level=LEVEL_PLAN;
  1543. X           where->pnum = i;
  1544. X-          Locks(1);
  1545. X           openpdata(&getplace2_pdata);
  1546. X           getplanet(getplace2_pdata, &p, Stars[where->snum]->planetpos[i]);
  1547. X-          Locks(0);
  1548. X           close(getplace2_pdata);
  1549. X           if (ignoreexpl || p->info[Playernum-1].explored || God) {
  1550. X               free(p);
  1551. X--- 156,163 ----
  1552. X***************
  1553. X*** 221,227 ****
  1554. X  {
  1555. X  reg int r=0;
  1556. X  
  1557. X!  if (s->is_dead) {
  1558. X      printf("%s #%d has been destroyed.\n", Shipnames[s->type], n);
  1559. X      r = 1;
  1560. X   } else if (s->owner!=Playernum) {
  1561. X--- 216,222 ----
  1562. X  {
  1563. X  reg int r=0;
  1564. X  
  1565. X!  if (!s->is_alive) {
  1566. X      printf("%s #%d has been destroyed.\n", Shipnames[s->type], n);
  1567. X      r = 1;
  1568. X   } else if (s->owner!=Playernum) {
  1569. X*** ../../GB2/help.c    Wed Jul  5 15:15:25 1989
  1570. X--- help.c    Fri Sep 15 07:28:07 1989
  1571. X***************
  1572. X*** 1,4 ****
  1573. X- 
  1574. X  /*
  1575. X   * Galactic Bloodshed (Robert Chansky, smq@b)
  1576. X   * help.c -- help on certain topics
  1577. X--- 1,3 ----
  1578. X*** ../../GB2/land.c    Thu Jul  6 07:19:44 1989
  1579. X--- land.c    Fri Sep 15 07:28:09 1989
  1580. X***************
  1581. X*** 15,20 ****
  1582. X--- 15,21 ----
  1583. X  #include <signal.h>
  1584. X  
  1585. X  int land_sectdata,land_shdata,land_pdata;
  1586. X+ int land_stdata;
  1587. X  extern char telegram_buf[AUTO_TELEG_SIZE];
  1588. X  
  1589. X  
  1590. X***************
  1591. X*** 26,37 ****
  1592. X  {
  1593. X  int land_handler();
  1594. X  char c;
  1595. X! shiptype *s,*s2;
  1596. X  planettype *p;
  1597. X  sectortype *sect;
  1598. X  placetype where;
  1599. X  bool dock,cont,planetmod=0,sectmod=0;
  1600. X  int numdest=0,ship2no,shipno,x= -1,y= -1,i,mask;
  1601. X  float fuel;
  1602. X  double Dist;
  1603. X  char buf[200];
  1604. X--- 27,39 ----
  1605. X  {
  1606. X  int land_handler();
  1607. X  char c;
  1608. X! shiptype *s,*s2,*s3;
  1609. X  planettype *p;
  1610. X  sectortype *sect;
  1611. X  placetype where;
  1612. X  bool dock,cont,planetmod=0,sectmod=0;
  1613. X  int numdest=0,ship2no,shipno,x= -1,y= -1,i,mask;
  1614. X+ int sh, sh3;
  1615. X  float fuel;
  1616. X  double Dist;
  1617. X  char buf[200];
  1618. X***************
  1619. X*** 88,99 ****
  1620. X  
  1621. X           printf("dock %s #%d with what ship #", Shipnames[s->type], shipno);
  1622. X           scanf("%d", &ship2no);
  1623. X-          Locks(1);
  1624. X           if (!getship(land_shdata, &s2, ship2no))
  1625. X             land_handler();
  1626. X-          Locks(0);
  1627. X  
  1628. X!     if (s2->is_docked) {
  1629. X          printf("ship #%d is already docked.\n",ship2no);
  1630. X          land_handler();
  1631. X      }
  1632. X--- 90,101 ----
  1633. X  
  1634. X           printf("dock %s #%d with what ship #", Shipnames[s->type], shipno);
  1635. X           scanf("%d", &ship2no);
  1636. X           if (!getship(land_shdata, &s2, ship2no))
  1637. X             land_handler();
  1638. X  
  1639. X!     if ( !(s->type == STYPE_FIGHTER && s2->type == STYPE_CARRIER) )
  1640. X!         {
  1641. X!        if (s2->is_docked) {
  1642. X          printf("ship #%d is already docked.\n",ship2no);
  1643. X          land_handler();
  1644. X      }
  1645. X***************
  1646. X*** 117,132 ****
  1647. X      s->is_docked = 1;
  1648. X      s->whatdest = LEVEL_SHIP;
  1649. X      s->destshipno = ship2no;
  1650. X!     s->xpos = s2->xpos + 1.0;
  1651. X!     s->ypos = s2->ypos;
  1652. X  
  1653. X      s2->is_docked = 1;
  1654. X      s2->whatdest = LEVEL_SHIP;
  1655. X      s2->destshipno = shipno;
  1656. X      putship(land_shdata, s2, ship2no);
  1657. X  
  1658. X      printf("ship #%d docked with ship #%d.\n",shipno, ship2no);
  1659. X  
  1660. X    } else {    /* docking with a planet */
  1661. X  
  1662. X       if (assault && s->popn < 1) {
  1663. X--- 119,210 ----
  1664. X      s->is_docked = 1;
  1665. X      s->whatdest = LEVEL_SHIP;
  1666. X      s->destshipno = ship2no;
  1667. X!     s->xpos = s2->xpos+int_rand(-1,1);
  1668. X!     s->ypos = s2->ypos+int_rand(-1,1);
  1669. X  
  1670. X      s2->is_docked = 1;
  1671. X      s2->whatdest = LEVEL_SHIP;
  1672. X      s2->destshipno = shipno;
  1673. X+ 
  1674. X+     putship(land_shdata, s, shipno);
  1675. X      putship(land_shdata, s2, ship2no);
  1676. X  
  1677. X      printf("ship #%d docked with ship #%d.\n",shipno, ship2no);
  1678. X+     } else { 
  1679. X+         /* docking fighters with a carrier */
  1680. X  
  1681. X+     if(s->whatorbits==LEVEL_PLAN)
  1682. X+         {
  1683. X+      openpdata(&land_pdata);
  1684. X+      getplanet(land_pdata, &p, Stars[s->storbits]->planetpos[s->pnumorbits]);
  1685. X+ 
  1686. X+     sh = p->ships;
  1687. X+     if(sh == shipno){
  1688. X+         p->ships = s->nextship;
  1689. X+     putplanet(land_pdata, p, Stars[s->storbits]->planetpos[s->pnumorbits]);
  1690. X+             } else {
  1691. X+     while(sh != shipno){
  1692. X+ 
  1693. X+          getship(land_shdata, &s3, sh);
  1694. X+ 
  1695. X+     sh3 = sh;
  1696. X+     sh = s3->nextship;
  1697. X+             }
  1698. X+     s3->nextship = s->nextship;
  1699. X+     if(sh3 == ship2no)s2->nextship = s3->nextship;
  1700. X+     putship(land_shdata, s3, sh3);
  1701. X+ 
  1702. X+                 }
  1703. X+         }
  1704. X+ 
  1705. X+ 
  1706. X+     if(s->whatorbits==LEVEL_STAR)
  1707. X+         {
  1708. X+      openpdata(&land_stdata);
  1709. X+      getsdata(land_stdata, &Stars[s->storbits], s->storbits);
  1710. X+ 
  1711. X+     sh = Stars[s->storbits]->ships;
  1712. X+     if(sh == shipno){
  1713. X+         Stars[s->storbits]->ships = s->nextship;
  1714. X+     putstar(land_stdata, Stars[s->storbits], s->storbits);
  1715. X+     close(land_stdata);
  1716. X+             } else {
  1717. X+ 
  1718. X+     while(sh != shipno){
  1719. X+          getship(land_shdata, &s3, sh);
  1720. X+     sh3 = sh;
  1721. X+     sh = s3->nextship;
  1722. X+             }
  1723. X+     s3->nextship = s->nextship;
  1724. X+     if(sh3 == ship2no)s2->nextship = s3->nextship;
  1725. X+ 
  1726. X+     putship(land_shdata, s3, sh3);
  1727. X+ 
  1728. X+                 }
  1729. X+         }
  1730. X+ 
  1731. X+ 
  1732. X+         s->fuel -= fuel;
  1733. X+         s->mass -= fuel * MASS_FUEL;
  1734. X+         s->is_docked = 1;
  1735. X+         s->whatdest = LEVEL_SHIP;
  1736. X+         s->destshipno = ship2no;
  1737. X+         s->nextship = 0;
  1738. X+ 
  1739. X+         s->xpos = s2->xpos;
  1740. X+         s->ypos = s2->ypos;
  1741. X+ 
  1742. X+         s->object.number = s2->object.number;
  1743. X+         s->object.number4 = 1; /* docked with carrier */
  1744. X+ 
  1745. X+         s2->object.number = shipno;
  1746. X+         s2->object.number4 += 1; /* number of fighters docked */
  1747. X+         s2->mass += s->mass;
  1748. X+ /* remove fighter from upper level linked list */
  1749. X+     putship(land_shdata, s, shipno);
  1750. X+     putship(land_shdata, s2, ship2no);
  1751. X+         }
  1752. X+ 
  1753. X    } else {    /* docking with a planet */
  1754. X  
  1755. X       if (assault && s->popn < 1) {
  1756. X***************
  1757. X*** 174,180 ****
  1758. X         GetMapSector(p, &x, &y);
  1759. X      opensectdata(&land_sectdata);
  1760. X      getsector(land_sectdata,§,p->sectormappos+(y*p->Maxx+x)*sizeof(sectortype));
  1761. X!        if (Race->likes[sect->des] == 0.0) {
  1762. X      printf("The ship is not built to land on that sector.\n");
  1763. X      cont = 0;
  1764. X      exit(0);
  1765. X--- 252,258 ----
  1766. X         GetMapSector(p, &x, &y);
  1767. X      opensectdata(&land_sectdata);
  1768. X      getsector(land_sectdata,§,p->sectormappos+(y*p->Maxx+x)*sizeof(sectortype));
  1769. X!        if (Race->likes[sect->des] == 0.0 && !sect->is_wasted) {
  1770. X      printf("The ship is not built to land on that sector.\n");
  1771. X      cont = 0;
  1772. X      exit(0);
  1773. X*** ../../GB2/launch.c    Wed Jul  5 15:15:28 1989
  1774. X--- launch.c    Fri Sep 15 07:28:10 1989
  1775. X***************
  1776. X*** 9,15 ****
  1777. X  extern jmp_buf main_jenv;
  1778. X  #include <signal.h>
  1779. X  
  1780. X! int launch_shdata,launch_pdata;
  1781. X  
  1782. X  
  1783. X  launch(APcount, argn,args)
  1784. X--- 9,15 ----
  1785. X  extern jmp_buf main_jenv;
  1786. X  #include <signal.h>
  1787. X  
  1788. X! int launch_shdata,launch_pdata,launch_stdata;
  1789. X  
  1790. X  
  1791. X  launch(APcount, argn,args)
  1792. X***************
  1793. X*** 18,24 ****
  1794. X  char args[MAXARGS][COMMANDSIZE];
  1795. X  {
  1796. X  int launch_handler();
  1797. X! shiptype *s,*s2;
  1798. X  planettype *p;
  1799. X  bool planet=0;
  1800. X  int shipno;
  1801. X--- 18,25 ----
  1802. X  char args[MAXARGS][COMMANDSIZE];
  1803. X  {
  1804. X  int launch_handler();
  1805. X! int sh, sh2, sh3;
  1806. X! shiptype *s,*s2,*s3;
  1807. X  planettype *p;
  1808. X  bool planet=0;
  1809. X  int shipno;
  1810. X***************
  1811. X*** 62,68 ****
  1812. X  
  1813. X    if (s->whatdest==LEVEL_SHIP) {
  1814. X  
  1815. X!       if (s->whatorbits==LEVEL_UNIV) {
  1816. X        if (!enufAP(Sdata.AP, APcount)) 
  1817. X          launch_handler();
  1818. X        else
  1819. X--- 63,71 ----
  1820. X  
  1821. X    if (s->whatdest==LEVEL_SHIP) {
  1822. X  
  1823. X!     (void)getship(launch_shdata, &s2, s->destshipno);
  1824. X! 
  1825. X!       if (s2->whatorbits==LEVEL_UNIV) {
  1826. X        if (!enufAP(Sdata.AP, APcount)) 
  1827. X          launch_handler();
  1828. X        else
  1829. X***************
  1830. X*** 73,93 ****
  1831. X        else
  1832. X            deductAPs(APcount, s->storbits, 0);
  1833. X      }
  1834. X!     Locks(1);
  1835. X!     (void)getship(launch_shdata, &s2, s->destshipno);
  1836. X!     Locks(0);
  1837. X      s->is_docked = 0;
  1838. X!     s->whatdest = LEVEL_UNIV;    /* no destination */
  1839. X      putship(launch_shdata, s, shipno);
  1840. X      s2->is_docked = 0;
  1841. X      s2->whatdest = LEVEL_UNIV;
  1842. X!     putship(launch_shdata, s2, s->destshipno);
  1843. X      close(launch_shdata);
  1844. X      free(s);
  1845. X      free(s2);
  1846. X!     printf("%s #%d undocked from ship #%d.\n", 
  1847. X!         Shipnames[s->type], shipno, s->destshipno);
  1848. X  
  1849. X    } else {
  1850. X        if (!enufAP(Stars[s->storbits]->AP, APcount)) 
  1851. X          launch_handler();
  1852. X--- 76,170 ----
  1853. X        else
  1854. X            deductAPs(APcount, s->storbits, 0);
  1855. X      }
  1856. X! 
  1857. X!     if( !(s->type == STYPE_FIGHTER && s2->type == STYPE_CARRIER) )
  1858. X!         {
  1859. X      s->is_docked = 0;
  1860. X!     s->whatdest = LEVEL_UNIV;
  1861. X!     sh2 = s->destshipno;
  1862. X!     s->destshipno = 0;
  1863. X      putship(launch_shdata, s, shipno);
  1864. X+ 
  1865. X      s2->is_docked = 0;
  1866. X      s2->whatdest = LEVEL_UNIV;
  1867. X!     s2->destshipno = 0;
  1868. X!     putship(launch_shdata, s2, sh2);
  1869. X      close(launch_shdata);
  1870. X      free(s);
  1871. X      free(s2);
  1872. X!         } else { /* fighters docked with carriers */
  1873. X  
  1874. X+     /* fix carrier linked list */
  1875. X+     printf("%d  %d \n\n",s2->object.number,shipno);
  1876. X+     sh = s2->object.number;
  1877. X+     printf("%d  %d \n\n",sh,shipno);
  1878. X+     if(sh == shipno) {
  1879. X+         s2->object.number = s->object.number;
  1880. X+         } else {
  1881. X+ 
  1882. X+     while(sh != shipno) {
  1883. X+ 
  1884. X+     printf("%d %d \n",sh,shipno);
  1885. X+         (void)getship(launch_shdata, &s3, sh);
  1886. X+     sh3 = sh;
  1887. X+     sh = s3->object.number;
  1888. X+         }
  1889. X+ 
  1890. X+     s3->object.number = s->object.number; /* change pointer */
  1891. X+     putship(launch_shdata, s3, sh3);
  1892. X+         }
  1893. X+ 
  1894. X+     /* fighter is on its own */
  1895. X+     s->is_docked = 0;
  1896. X+     s->whatdest = LEVEL_UNIV;
  1897. X+     s->whatorbits = s2->whatorbits;
  1898. X+     s->object.number = 0;
  1899. X+     s->object.number4 = 0;
  1900. X+     sh2 = s->destshipno;
  1901. X+     s->destshipno = 0;
  1902. X+ 
  1903. X+     s->xpos = s2->xpos+1;
  1904. X+     s->ypos = s2->ypos;
  1905. X+     s->storbits = s2->storbits;
  1906. X+     s->pnumorbits = s2->pnumorbits;
  1907. X+ 
  1908. X+     s2->mass -= s->mass; /* carrier is lighter */
  1909. X+     s2->object.number4 -= 1;
  1910. X+ /* put fighter into the appropriate linked list (planet/star/universe).
  1911. X+    it is put into the level of the carrier */
  1912. X+ 
  1913. X+     if(s->whatorbits==LEVEL_PLAN)
  1914. X+     {
  1915. X+   openpdata(&launch_pdata);
  1916. X+   getplanet(launch_pdata, &p, Stars[s->storbits]->planetpos[s->pnumorbits]);
  1917. X+     s->nextship = p->ships;
  1918. X+     p->ships = shipno;
  1919. X+   putplanet(launch_pdata,p,Stars[s->storbits]->planetpos[s->pnumorbits]);
  1920. X+       close(launch_pdata);
  1921. X+     }
  1922. X+     if(s->whatorbits==LEVEL_STAR)
  1923. X+     {
  1924. X+   openstardata(&launch_stdata);
  1925. X+   getsdata(launch_stdata, &Stars[s->storbits],s->storbits);
  1926. X+     s->nextship = Stars[s->storbits]->ships;
  1927. X+     Stars[s->storbits]->ships = shipno;
  1928. X+   putstar(launch_stdata, Stars[s->storbits],s->storbits);
  1929. X+     close(launch_stdata);
  1930. X+     }
  1931. X+ 
  1932. X+     putship(launch_shdata, s, shipno);
  1933. X+     putship(launch_shdata, s2, sh2);
  1934. X+     close(launch_shdata);
  1935. X+ 
  1936. X+             }
  1937. X+ 
  1938. X+ 
  1939. X+     printf("%s #%d undocked from %s #%d.\n", 
  1940. X+         Shipnames[s->type], shipno, Shipnames[s2->type],sh2);
  1941. X+ 
  1942. X+     free(s);
  1943. X+     free(s2);
  1944. X+ 
  1945. X    } else {
  1946. X        if (!enufAP(Stars[s->storbits]->AP, APcount)) 
  1947. X          launch_handler();
  1948. X***************
  1949. X*** 123,129 ****
  1950. X  
  1951. X  
  1952. X    if (s->type == OTYPE_CANIST)
  1953. X!     s->orders.object.number = 20;    /* canister dissapates after 20 turns */
  1954. X  
  1955. X    s->notified = 0;
  1956. X    putship(launch_shdata, s, shipno);
  1957. X--- 200,206 ----
  1958. X  
  1959. X  
  1960. X    if (s->type == OTYPE_CANIST)
  1961. X!     s->object.number = 20;    /* canister dissapates after 20 turns */
  1962. X  
  1963. X    s->notified = 0;
  1964. X    putship(launch_shdata, s, shipno);
  1965. END_OF_FILE
  1966. if test 52681 -ne `wc -c <'patches01b'`; then
  1967.     echo shar: \"'patches01b'\" unpacked with wrong size!
  1968. fi
  1969. # end of 'patches01b'
  1970. fi
  1971. echo shar: End of archive 2 \(of 4\).
  1972. cp /dev/null ark2isdone
  1973. MISSING=""
  1974. for I in 1 2 3 4 ; do
  1975.     if test ! -f ark${I}isdone ; then
  1976.     MISSING="${MISSING} ${I}"
  1977.     fi
  1978. done
  1979. if test "${MISSING}" = "" ; then
  1980.     echo You have unpacked all 4 archives.
  1981.     rm -f ark[1-9]isdone
  1982. else
  1983.     echo You still need to unpack the following archives:
  1984.     echo "        " ${MISSING}
  1985. fi
  1986. ##  End of shell archive.
  1987. exit 0
  1988.